package com.sddf.system.mode.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.NoArgsConstructor;

import java.io.Serializable;
import java.math.BigDecimal;

/**
 * 用户详情表
 * @TableName u_user_detail
 */
@TableName(value ="u_user_detail")
@Builder
@AllArgsConstructor
@NoArgsConstructor
public class UserDetail implements Serializable {
    /**
     * 账户ID（引用u_user表主键）
     */
    @TableId
    private Long id;

    /**
     * 用户名
     */
    private String userName;

    /**
     * 手机号
     */
    private String phone;

    /**
     * 借款金额
     */
    private BigDecimal borrowMoney;

    /**
     * 用户编码
     */
    private String userCode;

    /**
     * 请求流水号
     */
    private String reqCode;

    /**
     * 0（未绑定银行卡）、1（已绑定）
     */
    private Integer cardBindStatus;

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    /**
     * 账户ID（引用u_user表主键）
     */
    public Long getId() {
        return id;
    }

    /**
     * 账户ID（引用u_user表主键）
     */
    public void setId(Long id) {
        this.id = id;
    }

    /**
     * 用户名
     */
    public String getUserName() {
        return userName;
    }

    /**
     * 用户名
     */
    public void setUserName(String userName) {
        this.userName = userName;
    }

    /**
     * 手机号
     */
    public String getPhone() {
        return phone;
    }

    /**
     * 手机号
     */
    public void setPhone(String phone) {
        this.phone = phone;
    }

    /**
     * 借款金额
     */
    public BigDecimal getBorrowMoney() {
        return borrowMoney;
    }

    /**
     * 借款金额
     */
    public void setBorrowMoney(BigDecimal borrowMoney) {
        this.borrowMoney = borrowMoney;
    }

    /**
     * 用户编码
     */
    public String getUserCode() {
        return userCode;
    }

    /**
     * 用户编码
     */
    public void setUserCode(String userCode) {
        this.userCode = userCode;
    }

    /**
     * 请求流水号
     */
    public String getReqCode() {
        return reqCode;
    }

    /**
     * 请求流水号
     */
    public void setReqCode(String reqCode) {
        this.reqCode = reqCode;
    }

    /**
     * 0（未绑定银行卡）、1（已绑定）
     */
    public Integer getCardBindStatus() {
        return cardBindStatus;
    }

    /**
     * 0（未绑定银行卡）、1（已绑定）
     */
    public void setCardBindStatus(Integer cardBindStatus) {
        this.cardBindStatus = cardBindStatus;
    }

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        UserDetail other = (UserDetail) that;
        return (this.getId() == null ? other.getId() == null : this.getId().equals(other.getId()))
            && (this.getUserName() == null ? other.getUserName() == null : this.getUserName().equals(other.getUserName()))
            && (this.getPhone() == null ? other.getPhone() == null : this.getPhone().equals(other.getPhone()))
            && (this.getBorrowMoney() == null ? other.getBorrowMoney() == null : this.getBorrowMoney().equals(other.getBorrowMoney()))
            && (this.getUserCode() == null ? other.getUserCode() == null : this.getUserCode().equals(other.getUserCode()))
            && (this.getReqCode() == null ? other.getReqCode() == null : this.getReqCode().equals(other.getReqCode()))
            && (this.getCardBindStatus() == null ? other.getCardBindStatus() == null : this.getCardBindStatus().equals(other.getCardBindStatus()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getId() == null) ? 0 : getId().hashCode());
        result = prime * result + ((getUserName() == null) ? 0 : getUserName().hashCode());
        result = prime * result + ((getPhone() == null) ? 0 : getPhone().hashCode());
        result = prime * result + ((getBorrowMoney() == null) ? 0 : getBorrowMoney().hashCode());
        result = prime * result + ((getUserCode() == null) ? 0 : getUserCode().hashCode());
        result = prime * result + ((getReqCode() == null) ? 0 : getReqCode().hashCode());
        result = prime * result + ((getCardBindStatus() == null) ? 0 : getCardBindStatus().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", id=").append(id);
        sb.append(", userName=").append(userName);
        sb.append(", phone=").append(phone);
        sb.append(", borrowMoney=").append(borrowMoney);
        sb.append(", userCode=").append(userCode);
        sb.append(", reqCode=").append(reqCode);
        sb.append(", cardBindStatus=").append(cardBindStatus);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append("]");
        return sb.toString();
    }
}